<div class="box">
  <div class="box-header">
    
    <ob_link><a class="btn" href="{:url('eaterAdd')}"><i class="fa fa-cart-plus">确认订单</i></a></ob_link>
    
  </div>
    
  <div class="box-body table-responsive">
    <table  class="table table-bordered table-hover">
      <thead>
      <tr>
          <th>菜品名称</th>
          <th>图片</th>
          <th>推荐指数</th>
          <th>价格</th>
          <th>份数</th>
      </tr>
      </thead>
      
      {notempty name='list'}
        <tbody>
            {volist name='list' id='vo'}
                <tr>
                  <td>{$vo.name}</td>
                   <td><img class="admin-list-img-size" src="{$vo.url|get_picture_url}"/></td>
                  <td>{$vo.recommend}</td>
                  <td>{$vo.price}</td>
                  <td class="col-md-2 text-center">
                        <ul class="count" style="margin:-5px;">
                            <li style="list-style: none; float:left;">
                            <span id="num-jian" class="num-jian"><ob_link class="btn"><i class="fa fa-minus"></i></ob_link></span></li>
                            <li style="list-style: none; float:left;"><input type="text" style="width:30px; margin:3px;" class="input-num" id="input-num" value="0" /></li>
                            <li style="list-style: none; float:left;"><span id="num-jia" class="num-jia"><ob_link class="btn"><i class="fa fa-plus"></i></ob_link></span></li>
                        </ul>
                  </td>
                </tr>
            {/volist}
        </tbody>
        {else/}
        <tbody><tr class="odd"><td colspan="7" class="text-center" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
      {/notempty}
    </table>
  </div>

  <div class="box-footer clearfix text-center">
      {$list->render()}
  </div>

</div>
<script type="text/javascript">
    $("body").on("click",".num-jian",function (m) {
           var obj = $(this).closest("ul").find(".input-num");
           if (obj.val() <= 0) {
                obj.val(0);
           } else {
                obj.val(parseInt(obj.val()) - 1);
           }
           obj.change();
     });
     $("body").on("click",".num-jia",function (m) {
           var obj = $(this).closest("ul").find(".input-num");
           obj.val(parseInt(obj.val()) + 1);
           obj.change();
     })

</script>
